import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import Element from 'element-ui'
import axios from "axios";
import echarts from 'echarts';
import ECharts from 'vue-echarts'

// 引入 ECharts 所需的各个组件和图表类型
import 'echarts/lib/chart/line'
import 'echarts/lib/component/tooltip'
import 'echarts/lib/component/title'
import 'echarts/lib/component/legend'
import 'echarts/lib/component/markLine'

// 注册组件
Vue.component('v-chart', ECharts)

// import * as echarts from "echarts";

Vue.prototype.$echarts = echarts;//挂载到vue原型

Vue.prototype.HOST = '/api';


// 修改 el-dialog 默认点击遮照不关闭
Element.Dialog.props.closeOnClickModal.default = false;



// 配置axios
axios.defaults.baseURL = "http://localhost:8090"
axios.interceptors.request.use((config) => {
      config.headers.token = localStorage.getItem('token')
    return config })
Vue.prototype.$axios = axios;
// 配置axios


Vue.use(ElementUI);
Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')


